
#ifndef SCENELOADER_H
#define SCENELOADER_H

#include <QDomDocument>
#include <QDomElement>
#include <scene.h>
#include <engine.h>
#include <gfx/idevice.h>
#include <gfx/mesh.h>


class SceneLoader
{
private:
  ceEngine*   _engine;
  iDevice*   _device;

  ceMesh* LoadMesh (QDomElement element);
  void LoadShadow (EntityNode* entity, QDomElement element);
  ceMatrix4f LoadMatrix4f (QDomElement element);
  Geometry* LoadGeometry (QDomElement element);

  QString     _geometryName;
  unsigned    _geometryIdx;

public:
  SceneLoader(ceEngine* engine);


  EntityNode* LoadEntityNode (QDomElement element);
  GroupNode* LoadGroupNode(QDomElement element);
  LODNode* LoadLODNode (QDomElement element);

  GroupNode* LoadGroupNode (const QString& filename);

  QString LoadName (QDomElement element);
  QString LoadName (const QString& filename);

  ceNode* LoadNode (QDomElement element);

  ceNode* Load (QDomElement element);
  ceNode* Load (const QString& filename);
};

#endif // SCENELOADER_H
